home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _FILE.FRM < prev    next >
Text File  |  1996-05-14  |  83KB  |  2,533 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFile 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "File"
  5.    ClientHeight    =   5160
  6.    ClientLeft      =   1485
  7.    ClientTop       =   2415
  8.    ClientWidth     =   7785
  9.    Height          =   5565
  10.    Left            =   1425
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   5160
  14.    ScaleWidth      =   7785
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2070
  17.    Width           =   7905
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4425
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7575
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7785
  37.       _Version        =   65536
  38.       _ExtentX        =   13732
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   5100
  49.       End
  50.       Begin Threed.SSCommand cmdNP 
  51.          Height          =   300
  52.          Index           =   1
  53.          Left            =   7455
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   255
  57.          _Version        =   65536
  58.          _ExtentX        =   450
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   ">"
  62.          BevelWidth      =   1
  63.          Font3D          =   3
  64.          RoundedCorners  =   0   'False
  65.          Outline         =   0   'False
  66.       End
  67.       Begin Threed.SSCommand cmdNP 
  68.          Height          =   300
  69.          Index           =   0
  70.          Left            =   6615
  71.          TabIndex        =   5
  72.          Top             =   90
  73.          Width           =   255
  74.          _Version        =   65536
  75.          _ExtentX        =   450
  76.          _ExtentY        =   529
  77.          _StockProps     =   78
  78.          Caption         =   "<"
  79.          BevelWidth      =   1
  80.          Font3D          =   3
  81.          RoundedCorners  =   0   'False
  82.          Outline         =   0   'False
  83.       End
  84.       Begin VB.Label Label2 
  85.          Caption         =   "&Select a function"
  86.          Height          =   255
  87.          Left            =   90
  88.          TabIndex        =   4
  89.          Top             =   120
  90.          Width           =   1275
  91.       End
  92.       Begin Threed.SSCommand SSCommand1 
  93.          Default         =   -1  'True
  94.          Height          =   300
  95.          Left            =   6930
  96.          TabIndex        =   3
  97.          Top             =   90
  98.          Width           =   465
  99.          _Version        =   65536
  100.          _ExtentX        =   820
  101.          _ExtentY        =   529
  102.          _StockProps     =   78
  103.          Caption         =   "&Go"
  104.          BevelWidth      =   1
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. End
  110. Attribute VB_Name = "frmFile"
  111. Attribute VB_Creatable = False
  112. Attribute VB_Exposed = False
  113. Option Explicit
  114. Option Base 1
  115.  
  116. Private Const Iteration = 10
  117.  
  118. Dim IsLoaded         As Integer
  119.  
  120. Dim TimerStartOk     As Integer
  121. Dim TimerCloseOk     As Integer
  122.  
  123. Dim TimerHandle      As Integer
  124. Dim TimerValue       As Long
  125.  
  126. Private Sub cmdNP_Click(Index As Integer)
  127.  
  128.    Call sub_NextPrev(cmb_Function, Index)
  129.  
  130. End Sub
  131.  
  132.  
  133.  
  134. Private Sub cmb_Function_Click()
  135.    
  136.    If (IsLoaded = False) Then Exit Sub
  137.    
  138.    Call cDisableFI(mdiT2W.Picture1)
  139.    
  140.    txt_Result = ""
  141.    
  142.    DoEvents
  143.    
  144.    Select Case cmb_Function.ListIndex
  145.       Case 0
  146.          Call TestAllSubDirectories
  147.       Case 1
  148.          Call TestChDir
  149.       Case 2
  150.          Call TestChDrive
  151.       Case 3
  152.          Call TestFileCompressExpandTab
  153.       Case 4
  154.          Call TestFileCopy
  155.       Case 5
  156.          Call TestFileMove
  157.       Case 6
  158.          Call TestFileFilter
  159.       Case 7
  160.          Call TestFileFilterNot
  161.       Case 8
  162.          Call TestFileSize
  163.       Case 9
  164.          Call TestFileLineCount
  165.       Case 10
  166.          Call TestFileUpperLower
  167.       Case 11
  168.          Call TestFileMerge
  169.       Case 12
  170.          Call TestFileSearchAndReplace
  171.       Case 13
  172.          Call TestFileSearch
  173.       Case 14
  174.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, False)
  175.       Case 15
  176.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, False)
  177.       Case 16
  178.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, False)
  179.       Case 17
  180.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, False)
  181.       Case 18
  182.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_SENSITIVE, True)
  183.       Case 19
  184.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_SENSITIVE, True)
  185.       Case 20
  186.          Call TestFileSort(SORT_ASCENDING + SORT_CASE_INSENSITIVE, True)
  187.       Case 21
  188.          Call TestFileSort(SORT_DESCENDING + SORT_CASE_INSENSITIVE, True)
  189.       Case 22
  190.          Call TestFileChangeChars
  191.       Case 23
  192.          Call TestIsFileX
  193.       Case 24
  194.          Call TestKillDir
  195.       Case 25
  196.          Call TestKillDirs
  197.       Case 26
  198.          Call TestGetDiskSpace
  199.       Case 27
  200.          Call TestGetDiskUsed
  201.       Case 28
  202.          Call TestGetDiskFree
  203.       Case 29
  204.          Call TestGetDiskClusterSize
  205.       Case 30
  206.          Call TestCountFiles
  207.       Case 31
  208.          Call TestCountDirectories
  209.       Case 32
  210.          Call TestRcsCountFileDir
  211.       Case 33
  212.          Call TestFilesSizeX
  213.       Case 34
  214.          Call TestRcsFilesSizeX
  215.       Case 35
  216.          Call TestTruncatePath
  217.       Case 36
  218.          Call TestMakeSplitPath
  219.       Case 37
  220.          Call TestFullPath
  221.       Case 38
  222.          Call TestRenameFile
  223.       Case 39
  224.          Call TestUniqueFileName
  225.       Case 40
  226.          Call TestFilesInDirectory
  227.       Case 41
  228.          Call TestSubDirectory
  229.       Case 42
  230.          Call TestFileGetAttribute
  231.       Case 43
  232.          Call TestFileSetAttribute
  233.       Case 44
  234.          Call TestFileSetAllAttributes
  235.       Case 45
  236.          Call TestFileResetAllAttributes
  237.       Case 46
  238.          Call TestFileCompareX
  239.       Case 47
  240.          Call TestFileDrive
  241.       Case 48
  242.          Call TestFilesInDirOnDisk
  243.       Case 49
  244.          Call TestFileDateTime
  245.       Case 50
  246.          Call TestFileStatistics
  247.       Case 51
  248.          Call TestGetDriveType
  249.       Case 52
  250.          Call TestPBFileCopy
  251.       Case 53
  252.          Call TestDBFileCopy
  253.       Case 54
  254.          Call TestFileUUCP
  255.    End Select
  256.  
  257.    DoEvents
  258.    Call cEnableFI(mdiT2W.Picture1)
  259.    
  260. End Sub
  261.  
  262.  
  263. Private Sub Form_Activate()
  264.  
  265.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  266.  
  267. End Sub
  268.  
  269. Private Sub Form_Load()
  270.  
  271.    IsLoaded = False
  272.    
  273.    Show
  274.  
  275.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_file.t2w")
  276.    
  277.    IsLoaded = True
  278.    
  279. End Sub
  280.  
  281. Private Sub SSCommand1_Click()
  282.    
  283.    Call cmb_Function_Click
  284.    
  285. End Sub
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294. Private Sub TestAllSubDirectories()
  295.  
  296.    Dim intResult        As Integer
  297.    Dim strResult        As String
  298.    Dim strDisplay       As String
  299.    
  300.    Dim i                As Long
  301.    
  302.    strResult = ""
  303.    strDisplay = ""
  304.    
  305.    i = -1
  306.  
  307.    TimerHandle = cTimerOpen()
  308.    TimerStartOk = cTimerStart(TimerHandle)
  309.    
  310.    strResult = cAllSubDirectories("C:", i)
  311.    
  312.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  313.    TimerCloseOk = cTimerClose(TimerHandle)
  314.    
  315.    strResult = cStringSAR(strResult, vbCrLf, vbCrLf, False)
  316.    
  317.    strDisplay = "Directories founden on drive C are " & i & vbCrLf & vbCrLf & strResult
  318.    
  319.    txt_Result = strDisplay
  320.  
  321. End Sub
  322.  
  323. Private Sub TestChDir()
  324.  
  325.    Dim intResult        As Integer
  326.    Dim strResult        As String
  327.    Dim strDisplay       As String
  328.    
  329.    Dim i                As Integer
  330.    
  331.    strResult = ""
  332.    strDisplay = ""
  333.    
  334.    For i = 1 To 26
  335.       intResult = cChDir(Chr$(64 + i) & ":\")
  336.       If (intResult = True) Then
  337.          strDisplay = strDisplay & "ChDir to \ on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  338.       End If
  339.    Next i
  340.      
  341.    txt_Result = strDisplay
  342.  
  343.    'time the function
  344.  
  345.    TimerHandle = cTimerOpen()
  346.    TimerStartOk = cTimerStart(TimerHandle)
  347.    
  348.    For i = 1 To Iteration
  349.       intResult = cChDir("C:\")
  350.    Next i
  351.    
  352.    intResult = cChDir(T2WDirTest)
  353.    
  354.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  355.    
  356.    TimerCloseOk = cTimerClose(TimerHandle)
  357.  
  358. End Sub
  359.  
  360. Private Sub TestChDrive()
  361.  
  362.    Dim intResult        As Integer
  363.    Dim strResult        As String
  364.    Dim strDisplay       As String
  365.    
  366.    Dim i                As Integer
  367.    
  368.    strResult = ""
  369.    strDisplay = ""
  370.    
  371.    For i = 1 To 26
  372.       intResult = cChDrive(Chr$(64 + i))
  373.       If (intResult = True) Then
  374.          strDisplay = strDisplay & "ChDrive on '" & Chr$(64 + i) & ":' is " & IIf(intResult = True, "succesfull", "not successfull") & vbCrLf
  375.       End If
  376.    Next i
  377.    
  378.    txt_Result = strDisplay
  379.  
  380.    'time the function
  381.  
  382.    TimerHandle = cTimerOpen()
  383.    TimerStartOk = cTimerStart(TimerHandle)
  384.    
  385.    For i = 1 To Iteration
  386.       intResult = cChDrive("C")
  387.    Next i
  388.    
  389.    intResult = cChDrive(T2WDirTest)
  390.    
  391.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  392.    
  393.    TimerCloseOk = cTimerClose(TimerHandle)
  394.  
  395. End Sub
  396.  
  397. Private Sub TestFileCompressExpandTab()
  398.  
  399.    Dim lngResult        As Long
  400.    Dim strResult        As String
  401.    Dim strDisplay       As String
  402.    
  403.    Dim i                As Long
  404.    
  405.    Dim File1            As String
  406.    Dim File2            As String
  407.    Dim File3            As String
  408.    
  409.    strResult = ""
  410.    strDisplay = ""
  411.    
  412.    File1 = T2WFileTest
  413.    File2 = "autoexec.tabcompressed"
  414.    File3 = "autoexec.tabexpanded"
  415.    
  416.    For i = 1 To 4
  417.       strDisplay = strDisplay & "File CompressTab (" & i & " spaces = 1 tab) " & File1 & " to " & File2 & " is " & cFileCompressTab(File1, File2, i) & vbCrLf
  418.       strDisplay = strDisplay & "File ExpandTab (" & i & " spaces = 1 tab) " & File2 & " to " & File3 & " is " & cFileExpandTab(File2, File3, i) & vbCrLf
  419.       strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  420.    Next i
  421.  
  422.    txt_Result = strDisplay
  423.  
  424.    'time the function
  425.  
  426.    TimerHandle = cTimerOpen()
  427.    TimerStartOk = cTimerStart(TimerHandle)
  428.    
  429.    For i = 1 To Iteration
  430.       lngResult = cFileExpandTab(File1, File2, 3)
  431.    Next i
  432.    
  433.    lngResult = cFileCompressTab(File2, File3, 3)
  434.    
  435.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  436.    
  437.    TimerCloseOk = cTimerClose(TimerHandle)
  438.  
  439. End Sub
  440.  
  441. Private Sub TestFileCopy()
  442.  
  443.    Dim lngResult        As Long
  444.    Dim strResult        As String
  445.    Dim strDisplay       As String
  446.    
  447.    Dim i                As Long
  448.    
  449.    Dim File1            As String
  450.    Dim File2            As String
  451.   
  452.    strResult = ""
  453.    strDisplay = ""
  454.    
  455.    File1 = T2WFileTest
  456.    File2 = "autoexec.copy"
  457.    
  458.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  459.    
  460.    strDisplay = strDisplay & "File Copy2 '" & File1 & "' to '" & File2 & "' is " & cFileCopy2(File1, File2) & vbCrLf & vbCrLf
  461.  
  462.    txt_Result = strDisplay
  463.  
  464.    'time the function
  465.  
  466.    TimerHandle = cTimerOpen()
  467.    TimerStartOk = cTimerStart(TimerHandle)
  468.    
  469.    For i = 1 To Iteration
  470.       lngResult = cFileCopy(File1, File2)
  471.    Next i
  472.    
  473.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  474.    
  475.    TimerCloseOk = cTimerClose(TimerHandle)
  476.  
  477. End Sub
  478.  
  479. Private Sub TestFileMove()
  480.  
  481.    Dim lngResult        As Long
  482.    Dim strResult        As String
  483.    Dim strDisplay       As String
  484.    
  485.    Dim i                As Long
  486.    
  487.    Dim File1            As String
  488.    Dim File2            As String
  489.   
  490.    strResult = ""
  491.    strDisplay = ""
  492.    
  493.    File1 = T2WFileTest
  494.    File2 = "c:\win95\autoexec.bat"
  495.    
  496.    strDisplay = strDisplay & "File Move '" & File1 & "' to '" & File2 & "' is " & cFileMove(File1, File2) & vbCrLf & vbCrLf
  497.    
  498.    txt_Result = strDisplay
  499.  
  500.    'time the function
  501.  
  502.    TimerHandle = cTimerOpen()
  503.    TimerStartOk = cTimerStart(TimerHandle)
  504.    
  505.    For i = 1 To Iteration
  506.       lngResult = cFileMove(File1, File2)
  507.    Next i
  508.    
  509.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  510.    
  511.    TimerCloseOk = cTimerClose(TimerHandle)
  512.  
  513. End Sub
  514.  
  515. Private Sub TestFileFilter()
  516.  
  517.    Dim lngResult        As Long
  518.    Dim strResult        As String
  519.    Dim strDisplay       As String
  520.    
  521.    Dim i                As Long
  522.    
  523.    Dim File1            As String
  524.    Dim File2            As String
  525.    
  526.    Dim Filter           As String
  527.   
  528.    strResult = ""
  529.    strDisplay = ""
  530.    
  531.    File1 = T2WFileTest
  532.    File2 = "autoexec.filter"
  533.    
  534.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  535.    Filter = Filter + LCase$(Filter)
  536.  
  537.    strDisplay = strDisplay & "File Filter (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  538.  
  539.    txt_Result = strDisplay
  540.  
  541.    'time the function
  542.  
  543.    TimerHandle = cTimerOpen()
  544.    TimerStartOk = cTimerStart(TimerHandle)
  545.    
  546.    For i = 1 To Iteration
  547.       lngResult = cFileFilter(File1, File2, Filter)
  548.    Next i
  549.    
  550.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  551.    
  552.    TimerCloseOk = cTimerClose(TimerHandle)
  553.  
  554. End Sub
  555.  
  556. Private Sub TestFileFilterNot()
  557.  
  558.    Dim lngResult        As Long
  559.    Dim strResult        As String
  560.    Dim strDisplay       As String
  561.    
  562.    Dim i                As Long
  563.    
  564.    Dim File1            As String
  565.    Dim File2            As String
  566.    
  567.    Dim Filter           As String
  568.   
  569.    strResult = ""
  570.    strDisplay = ""
  571.    
  572.    File1 = T2WFileTest
  573.    File2 = "autoexec.filternot"
  574.    
  575.    Filter = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  576.    Filter = Filter + LCase$(Filter)
  577.  
  578.    strDisplay = strDisplay & "File Filter Not (A-Z, a-z) '" & File1 & "' to '" & File2 & "' is " & cFileFilter(File1, File2, Filter) & vbCrLf & vbCrLf
  579.  
  580.    txt_Result = strDisplay
  581.  
  582.    'time the function
  583.  
  584.    TimerHandle = cTimerOpen()
  585.    TimerStartOk = cTimerStart(TimerHandle)
  586.    
  587.    For i = 1 To Iteration
  588.       lngResult = cFileFilterNot(File1, File2, Filter)
  589.    Next i
  590.    
  591.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  592.    
  593.    TimerCloseOk = cTimerClose(TimerHandle)
  594.  
  595. End Sub
  596.  
  597. Private Sub TestFileSize()
  598.  
  599.    Dim lngResult        As Long
  600.    Dim strResult        As String
  601.    Dim strDisplay       As String
  602.    
  603.    Dim i                As Long
  604.    
  605.    Dim File1            As String
  606.    Dim File2            As String
  607.   
  608.    strResult = ""
  609.    strDisplay = ""
  610.    
  611.    File1 = T2WFileTest
  612.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  613.    
  614.    File1 = "c:\autoexec.bat"
  615.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  616.    
  617.    File1 = "c:\config.sys"
  618.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  619.    
  620.    File1 = "c:\test.tst"
  621.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  622.    
  623.    File1 = "c:\command.com"
  624.    strDisplay = strDisplay & "File Size '" & File1 & "' is " & cFileSize(File1) & vbCrLf & vbCrLf
  625.    
  626.    txt_Result = strDisplay
  627.  
  628.    'time the function
  629.  
  630.    TimerHandle = cTimerOpen()
  631.    TimerStartOk = cTimerStart(TimerHandle)
  632.    
  633.    For i = 1 To Iteration
  634.       lngResult = cFileSize(File1)
  635.    Next i
  636.    
  637.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  638.    
  639.    TimerCloseOk = cTimerClose(TimerHandle)
  640.  
  641. End Sub
  642.  
  643. Private Sub TestFileLineCount()
  644.  
  645.    Dim lngResult        As Long
  646.    Dim strResult        As String
  647.    Dim strDisplay       As String
  648.    
  649.    Dim i                As Long
  650.    
  651.    Dim File1            As String
  652.    Dim File2            As String
  653.   
  654.    strResult = ""
  655.    strDisplay = ""
  656.    
  657.    File1 = T2WFileTest
  658.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  659.  
  660.    File1 = "c:\autoexec.bat"
  661.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  662.    
  663.    File1 = "c:\config.sys"
  664.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  665.    
  666.    File1 = "c:\test.tst"
  667.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  668.    
  669.    File1 = "c:\command.com"
  670.    strDisplay = strDisplay & "Total lines in '" & File1 & "' are " & cFileLineCount(File1) & vbCrLf & vbCrLf
  671.    
  672.    txt_Result = strDisplay
  673.  
  674.    'time the function
  675.  
  676.    TimerHandle = cTimerOpen()
  677.    TimerStartOk = cTimerStart(TimerHandle)
  678.    
  679.    For i = 1 To Iteration
  680.       lngResult = cFileLineCount(File1)
  681.    Next i
  682.    
  683.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  684.    
  685.    TimerCloseOk = cTimerClose(TimerHandle)
  686.  
  687. End Sub
  688.  
  689. Public Sub TestFileUpperLower()
  690.  
  691.    Dim lngResult        As Long
  692.    Dim strResult        As String
  693.    Dim strDisplay       As String
  694.    
  695.    Dim i                As Long
  696.    
  697.    Dim File1            As String
  698.    Dim File2            As String
  699.    Dim File3            As String
  700.    
  701.    strResult = ""
  702.    strDisplay = ""
  703.    
  704.    File1 = T2WFileTest
  705.    File2 = "autoexec.toupper"
  706.    File3 = "autoexec.tolower"
  707.    
  708.    strDisplay = strDisplay & "File to upper '" & File1 & "' to '" & File2 & "' is " & cFileToUpper(File1, File2) & vbCrLf & vbCrLf
  709.    strDisplay = strDisplay & "File to lower '" & File1 & "' to '" & File3 & "' is " & cFileToLower(File1, File3) & vbCrLf & vbCrLf
  710.  
  711.    txt_Result = strDisplay
  712.  
  713.    'time the function
  714.  
  715.    TimerHandle = cTimerOpen()
  716.    TimerStartOk = cTimerStart(TimerHandle)
  717.    
  718.    For i = 1 To Iteration
  719.       lngResult = cFileToUpper(File1, File2)
  720.    Next i
  721.    
  722.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  723.    
  724.    TimerCloseOk = cTimerClose(TimerHandle)
  725.  
  726. End Sub
  727.  
  728. Private Sub TestFileMerge()
  729.  
  730.    Dim lngResult        As Long
  731.    Dim strResult        As String
  732.    Dim strDisplay       As String
  733.    
  734.    Dim i                As Long
  735.    
  736.    Dim File1            As String
  737.    Dim File2            As String
  738.    Dim File3            As String
  739.   
  740.    strResult = ""
  741.    strDisplay = ""
  742.    
  743.    File1 = T2WFileTest
  744.    File2 = "c:\config.sys"
  745.    File3 = "autoexec.merged"
  746.    
  747.    strDisplay = strDisplay & "File Merge '" & File1 & "' and '" & File2 & "' to '" & File3 & "' is " & cFileMerge(File1, File2, File3) & vbCrLf & vbCrLf
  748.  
  749.    txt_Result = strDisplay
  750.  
  751.    'time the function
  752.  
  753.    TimerHandle = cTimerOpen()
  754.    TimerStartOk = cTimerStart(TimerHandle)
  755.    
  756.    For i = 1 To Iteration
  757.       lngResult = cFileMerge(File1, File2, File3)
  758.    Next i
  759.    
  760.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  761.    
  762.    TimerCloseOk = cTimerClose(TimerHandle)
  763.  
  764. End Sub
  765.  
  766. Private Sub TestFileSearchAndReplace()
  767.  
  768.    Dim lngResult        As Long
  769.    Dim strResult        As String
  770.    Dim strDisplay       As String
  771.    
  772.    Dim i                As Long
  773.    
  774.    Dim File1            As String
  775.    Dim File2            As String
  776.    
  777.    Dim Search           As String
  778.    Dim Replace          As String
  779.    
  780.    strResult = ""
  781.    strDisplay = ""
  782.    
  783.    File1 = T2WFileTest
  784.    File2 = "autoexec.searchandreplace"
  785.    
  786.    Search = "rem SET "
  787.    Replace = "REM set "
  788.  
  789.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  790.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Search & "' -> '" & Replace & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Search, Replace, "tmp.tmp", True) & vbCrLf & vbCrLf
  791.    strDisplay = strDisplay & "File Search-Replace (sensitive) : '" & Replace & "' -> '" & Search & "' in '" & File2 & "' is " & cFileSearchAndReplace(File2, Replace, Search, "tmp.tmp", True) & vbCrLf & vbCrLf
  792.    strDisplay = strDisplay & "Compare file contents (insensitive) '" & File2 & "' with '" & File1 & "' is " & IIf(cCmpFileContents(File2, File1, False) = True, "same", "not same") & vbCrLf & vbCrLf
  793.  
  794.    txt_Result = strDisplay
  795.  
  796.    'time the function
  797.  
  798.    TimerHandle = cTimerOpen()
  799.    TimerStartOk = cTimerStart(TimerHandle)
  800.    
  801.    For i = 1 To Iteration
  802.       If ((i Mod 2) = 1) Then
  803.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  804.       Else
  805.          lngResult = cFileSearchAndReplace(File1, Search, Replace, "", True)
  806.       End If
  807.    Next i
  808.    
  809.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  810.    
  811.    TimerCloseOk = cTimerClose(TimerHandle)
  812.  
  813. End Sub
  814.  
  815. Private Sub TestFileSearch()
  816.  
  817.    Dim lngResult        As Long
  818.    Dim strResult        As String
  819.    Dim strDisplay       As String
  820.    
  821.    Dim i                As Long
  822.    
  823.    Dim File1            As String
  824.    
  825.    Dim Search1          As String
  826.    Dim Search2          As String
  827.    
  828.    strResult = ""
  829.    strDisplay = ""
  830.    
  831.    File1 = T2WFileTest
  832.    
  833.    Search1 = "re"
  834.    Search2 = "SET"
  835.  
  836.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, False) & vbCrLf & vbCrLf
  837.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, False) & vbCrLf & vbCrLf
  838.    strDisplay = strDisplay & "File Search (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, False) & vbCrLf & vbCrLf
  839.    strDisplay = strDisplay & "File Search and Count (insensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, False) & vbCrLf & vbCrLf
  840.  
  841.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearch(File1, Search1, True) & vbCrLf & vbCrLf
  842.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search1 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search1, True) & vbCrLf & vbCrLf
  843.    strDisplay = strDisplay & "File Search (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearch(File1, Search2, True) & vbCrLf & vbCrLf
  844.    strDisplay = strDisplay & "File Search and Count (sensitive) : '" & Search2 & "' in '" & File1 & "' is " & cFileSearchCount(File1, Search2, True) & vbCrLf & vbCrLf
  845.  
  846.    txt_Result = strDisplay
  847.  
  848.    'time the function
  849.  
  850.    TimerHandle = cTimerOpen()
  851.    TimerStartOk = cTimerStart(TimerHandle)
  852.    
  853.    For i = 1 To Iteration
  854.       If ((i Mod 2) = 1) Then
  855.          lngResult = cFileSearch(File1, Search1, False)
  856.       Else
  857.          lngResult = cFileSearchCount(File1, Search2, False)
  858.       End If
  859.    Next i
  860.    
  861.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  862.    
  863.    TimerCloseOk = cTimerClose(TimerHandle)
  864.  
  865. End Sub
  866.  
  867. Private Sub TestFileSort(intSortMethod As Integer, intVarFix As Integer)
  868.    
  869.    Dim lngResult        As Long
  870.    Dim strResult        As String
  871.    Dim strDisplay       As String
  872.    
  873.    Dim i                As Long
  874.    Dim n                As Long
  875.    
  876.    Dim File1            As String
  877.    Dim File2            As String
  878.   
  879.    strResult = ""
  880.    strDisplay = ""
  881.  
  882.    File1 = T2WFileTest
  883.    File2 = "autoexec.sort" & intSortMethod & Abs(intVarFix)
  884.    
  885.    strDisplay = "The 7 first lines in '" & File1 & "' before sorting are " & vbCrLf & vbCrLf
  886.    
  887.    Close #1
  888.    Open File1 For Input Shared As #1
  889.    For i = 1 To 7
  890.       Line Input #1, strResult
  891.       strDisplay = strDisplay + strResult + vbCrLf
  892.    Next i
  893.    Close #1
  894.  
  895.    If (intVarFix = False) Then
  896.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  897.    Else
  898.       lngResult = cFileSort(File1, File2, intSortMethod, 7, 0, 7, n)
  899.    End If
  900.    
  901.    strDisplay = strDisplay + vbCrLf
  902.    strDisplay = strDisplay + "The 7 first lines in '" & File2 & "' after sorting are " & vbCrLf & vbCrLf
  903.    
  904.    Close #1
  905.    Open File2 For Input Shared As #1
  906.    For i = 1 To 7
  907.       Line Input #1, strResult
  908.       strDisplay = strDisplay + strResult + vbCrLf
  909.    Next i
  910.    Close #1
  911.  
  912.    strDisplay = strDisplay + vbCrLf
  913.    
  914.    Select Case intSortMethod
  915.       Case (SORT_ASCENDING + SORT_CASE_SENSITIVE):
  916.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and CS is '" & lngResult & "' and records are '" & n & "'"
  917.       Case (SORT_DESCENDING + SORT_CASE_SENSITIVE):
  918.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and CS is '" & lngResult & "' and records are '" & n & "'"
  919.       Case (SORT_ASCENDING + SORT_CASE_INSENSITIVE):
  920.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in ASC and NS is '" & lngResult & "' and records are '" & n & "'"
  921.       Case (SORT_DESCENDING + SORT_CASE_INSENSITIVE):
  922.          strDisplay = strDisplay + "Sort '" & File1 & "' into '" & File2 & "' in DSC and NS is '" & lngResult & "' and records are '" & n & "'"
  923.    End Select
  924.  
  925.    txt_Result = strDisplay
  926.  
  927.    'time the function
  928.  
  929.    TimerHandle = cTimerOpen()
  930.    TimerStartOk = cTimerStart(TimerHandle)
  931.    
  932.    For i = 1 To Iteration
  933.       lngResult = cFileSort(File1, File2, intSortMethod, -1, -1, -1, n)
  934.    Next i
  935.    
  936.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  937.    
  938.    TimerCloseOk = cTimerClose(TimerHandle)
  939.    
  940. End Sub
  941.  
  942. Private Sub TestFileChangeChars()
  943.  
  944.    Dim lngResult        As Long
  945.    Dim strResult        As String
  946.    Dim strDisplay       As String
  947.    
  948.    Dim i                As Long
  949.    
  950.    Dim File1            As String
  951.    Dim File2            As String
  952.    
  953.    Dim Change1          As String
  954.    Dim Change2          As String
  955.    
  956.    strResult = ""
  957.    strDisplay = ""
  958.    
  959.    File1 = T2WFileTest
  960.    File2 = "autoexec.changechars"
  961.    
  962.    Change1 = "REM"
  963.    Change2 = "mer"
  964.    
  965.    txt_Result = strDisplay
  966.  
  967.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  968.    
  969.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' before change are " & vbCrLf & vbCrLf
  970.    
  971.    Close #1
  972.    Open File2 For Input Shared As #1
  973.    For i = 1 To 7
  974.       Line Input #1, strResult
  975.       strDisplay = strDisplay + strResult + vbCrLf
  976.    Next i
  977.    Close #1
  978.  
  979.    strDisplay = strDisplay + vbCrLf
  980.    
  981.    strDisplay = strDisplay & "File Change Chars : '" & Change1 & "' -> '" & Change2 & "' in '" & File2 & "' is " & cFileChangeChars(File2, Change1, Change2, "file1.file1") & vbCrLf & vbCrLf
  982.  
  983.    strDisplay = strDisplay & "The 7 first lines in '" & File2 & "' after change are " & vbCrLf & vbCrLf
  984.    
  985.    Close #1
  986.    Open File2 For Input Shared As #1
  987.    For i = 1 To 7
  988.       Line Input #1, strResult
  989.       strDisplay = strDisplay + strResult + vbCrLf
  990.    Next i
  991.    Close #1
  992.    
  993.    txt_Result = strDisplay
  994.  
  995.    'time the function
  996.  
  997.    TimerHandle = cTimerOpen()
  998.    TimerStartOk = cTimerStart(TimerHandle)
  999.    
  1000.    For i = 1 To Iteration
  1001.       If ((i Mod 2) = 1) Then
  1002.          lngResult = cFileChangeChars(File2, Change1, Change2, "")
  1003.       Else
  1004.          lngResult = cFileChangeChars(File2, Change2, Change1, "")
  1005.       End If
  1006.    Next i
  1007.    
  1008.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1009.    
  1010.    TimerCloseOk = cTimerClose(TimerHandle)
  1011.  
  1012. End Sub
  1013.  
  1014. Private Sub TestIsFileX()
  1015.  
  1016.    Dim intResult        As Integer
  1017.    Dim strResult        As String
  1018.    Dim strDisplay       As String
  1019.    
  1020.    Dim i                As Integer
  1021.    
  1022.    Dim File1            As String
  1023.    
  1024.    strResult = ""
  1025.    strDisplay = ""
  1026.    
  1027.    File1 = T2WFileTest
  1028.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  1029.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  1030.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  1031.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  1032.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  1033.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  1034.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  1035.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  1036.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  1037.      
  1038.    File1 = cGetWindowsDirectory() & "\user.dat"
  1039.    
  1040.    strDisplay = strDisplay & vbCrLf
  1041.    strDisplay = strDisplay & "File '" & File1 & "' is " & vbCrLf & vbCrLf
  1042.    strDisplay = strDisplay & IIf(cIsFilenameValid(File1), " a good filename", " is not a good filename") & vbCrLf
  1043.    strDisplay = strDisplay & IIf(cIsFileArchive(File1), " archive", " not archive") & vbCrLf
  1044.    strDisplay = strDisplay & IIf(cIsFileHidden(File1), " hidden", " not hidden") & vbCrLf
  1045.    strDisplay = strDisplay & IIf(cIsFileNormal(File1), " normal", " not normal") & vbCrLf
  1046.    strDisplay = strDisplay & IIf(cIsFileReadOnly(File1), " read-only", " not read-only") & vbCrLf
  1047.    strDisplay = strDisplay & IIf(cIsFileSubDir(File1), " sub-directory", " not sub-directory") & vbCrLf
  1048.    strDisplay = strDisplay & IIf(cIsFileSystem(File1), " system", " not system") & vbCrLf
  1049.    strDisplay = strDisplay & IIf(cIsFileCompressed(File1), " compressed", " not compressed") & vbCrLf & vbCrLf
  1050.      
  1051.    txt_Result = strDisplay
  1052.  
  1053.    'time the function
  1054.  
  1055.    TimerHandle = cTimerOpen()
  1056.    TimerStartOk = cTimerStart(TimerHandle)
  1057.    
  1058.    For i = 1 To Iteration
  1059.       intResult = cIsFilenameValid(File1)
  1060.    Next i
  1061.    
  1062.    intResult = cChDir(T2WDirTest)
  1063.    
  1064.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1065.    
  1066.    TimerCloseOk = cTimerClose(TimerHandle)
  1067.  
  1068. End Sub
  1069.  
  1070. Private Sub TestKillDir()
  1071.  
  1072.    Dim intResult        As Integer
  1073.    Dim strResult        As String
  1074.    Dim strDisplay       As String
  1075.    
  1076.    Dim i                As Integer
  1077.    
  1078.    Dim File1            As String
  1079.    
  1080.    strResult = ""
  1081.    strDisplay = ""
  1082.    
  1083.    File1 = "c:\this is a test for KillDir"
  1084.    
  1085.    intResult = cMakeDir(File1)
  1086.    
  1087.    strDisplay = strDisplay & "Directory '" & File1 & "' is created" & vbCrLf & vbCrLf
  1088.    
  1089.    strDisplay = strDisplay & "Directory '" & File1 & "' is " & IIf(cKillDir(File1) = True, "deleted", "not deleted") & vbCrLf & vbCrLf
  1090.      
  1091.    txt_Result = strDisplay
  1092.  
  1093.    'time the function
  1094.  
  1095.    TimerHandle = cTimerOpen()
  1096.    TimerStartOk = cTimerStart(TimerHandle)
  1097.    
  1098.    For i = 1 To Iteration
  1099.       intResult = cKillDir(File1)
  1100.    Next i
  1101.    
  1102.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1103.    
  1104.    TimerCloseOk = cTimerClose(TimerHandle)
  1105.  
  1106. End Sub
  1107.  
  1108. Private Sub TestKillDirs()
  1109.  
  1110.    Dim intResult        As Integer
  1111.    Dim strResult        As String
  1112.    Dim strDisplay       As String
  1113.    
  1114.    Dim i                As Integer
  1115.    
  1116.    Dim File1            As String
  1117.    
  1118.    strResult = ""
  1119.    strDisplay = ""
  1120.    
  1121.    File1 = "c:\this1\this2\this3\this4"
  1122.    
  1123.    intResult = cMakeMultipleDir(File1)
  1124.    
  1125.    strDisplay = strDisplay & "Directories '" & File1 & "' are created" & vbCrLf & vbCrLf
  1126.    
  1127.    strDisplay = strDisplay & "Directories '" & File1 & "' are " & IIf(cKillDirs("c:\this1", True) > 0, "deleted", "not deleted") & vbCrLf & vbCrLf
  1128.      
  1129.    txt_Result = strDisplay
  1130.  
  1131.    'time the function
  1132.  
  1133.    TimerHandle = cTimerOpen()
  1134.    TimerStartOk = cTimerStart(TimerHandle)
  1135.    
  1136.    For i = 1 To Iteration
  1137.       intResult = cKillDirs(File1, True)
  1138.    Next i
  1139.    
  1140.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1141.    
  1142.    TimerCloseOk = cTimerClose(TimerHandle)
  1143.  
  1144. End Sub
  1145.  
  1146. Private Sub TestGetDiskSpace()
  1147.  
  1148.    Dim lngResult        As Long
  1149.    Dim strResult        As String
  1150.    Dim strDisplay       As String
  1151.    
  1152.    Dim i                As Integer
  1153.    
  1154.    strResult = ""
  1155.    strDisplay = ""
  1156.    
  1157.    For i = 1 To 26
  1158.       lngResult = cGetDiskSpace(Chr$(64 + i))
  1159.       If (lngResult <> True) Then
  1160.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  1161.       End If
  1162.    Next i
  1163.      
  1164.    txt_Result = strDisplay
  1165.  
  1166.    'time the function
  1167.  
  1168.    TimerHandle = cTimerOpen()
  1169.    TimerStartOk = cTimerStart(TimerHandle)
  1170.    
  1171.    For i = 1 To Iteration
  1172.       lngResult = cGetDiskSpace("C")
  1173.    Next i
  1174.    
  1175.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1176.    
  1177.    TimerCloseOk = cTimerClose(TimerHandle)
  1178.  
  1179. End Sub
  1180.  
  1181. Private Sub TestGetDiskUsed()
  1182.  
  1183.    Dim lngResult        As Long
  1184.    Dim strResult        As String
  1185.    Dim strDisplay       As String
  1186.    
  1187.    Dim i                As Integer
  1188.    
  1189.    strResult = ""
  1190.    strDisplay = ""
  1191.    
  1192.    For i = 1 To 26
  1193.       lngResult = cGetDiskUsed(Chr$(64 + i))
  1194.       If (lngResult <> True) Then
  1195.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  1196.       End If
  1197.    Next i
  1198.      
  1199.    txt_Result = strDisplay
  1200.  
  1201.    'time the function
  1202.  
  1203.    TimerHandle = cTimerOpen()
  1204.    TimerStartOk = cTimerStart(TimerHandle)
  1205.    
  1206.    For i = 1 To Iteration
  1207.       lngResult = cGetDiskUsed("C")
  1208.    Next i
  1209.    
  1210.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1211.    
  1212.    TimerCloseOk = cTimerClose(TimerHandle)
  1213.  
  1214. End Sub
  1215.  
  1216. Private Sub TestGetDiskFree()
  1217.  
  1218.    Dim lngResult        As Long
  1219.    Dim strResult        As String
  1220.    Dim strDisplay       As String
  1221.    
  1222.    Dim i                As Integer
  1223.    
  1224.    strResult = ""
  1225.    strDisplay = ""
  1226.    
  1227.    For i = 1 To 26
  1228.       lngResult = cGetDiskFree(Chr$(64 + i))
  1229.       If (lngResult <> True) Then
  1230.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  1231.       End If
  1232.    Next i
  1233.      
  1234.    txt_Result = strDisplay
  1235.  
  1236.    'time the function
  1237.  
  1238.    TimerHandle = cTimerOpen()
  1239.    TimerStartOk = cTimerStart(TimerHandle)
  1240.    
  1241.    For i = 1 To Iteration
  1242.       lngResult = cGetDiskFree("C")
  1243.    Next i
  1244.    
  1245.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1246.    
  1247.    TimerCloseOk = cTimerClose(TimerHandle)
  1248.  
  1249. End Sub
  1250.  
  1251. Private Sub TestGetDiskClusterSize()
  1252.  
  1253.    Dim lngResult        As Long
  1254.    Dim strResult        As String
  1255.    Dim strDisplay       As String
  1256.    
  1257.    Dim i                As Integer
  1258.    
  1259.    strResult = ""
  1260.    strDisplay = ""
  1261.    
  1262.    For i = 1 To 26
  1263.       lngResult = cGetDiskClusterSize(Chr$(64 + i))
  1264.       If (lngResult <> True) Then
  1265.          strDisplay = strDisplay & "DiskSpace for '" & Chr$(64 + i) & ":' is " & lngResult & vbCrLf
  1266.       End If
  1267.    Next i
  1268.      
  1269.    txt_Result = strDisplay
  1270.  
  1271.    'time the function
  1272.  
  1273.    TimerHandle = cTimerOpen()
  1274.    TimerStartOk = cTimerStart(TimerHandle)
  1275.    
  1276.    For i = 1 To Iteration
  1277.       lngResult = cGetDiskClusterSize("C")
  1278.    Next i
  1279.    
  1280.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1281.    
  1282.    TimerCloseOk = cTimerClose(TimerHandle)
  1283.  
  1284. End Sub
  1285.  
  1286. Private Sub TestRcsCountFileDir()
  1287.  
  1288.    Dim lngResult        As Long
  1289.    Dim strResult        As String
  1290.    Dim strDisplay       As String
  1291.    
  1292.    Dim i                As Integer
  1293.    
  1294.    strResult = ""
  1295.    strDisplay = ""
  1296.    
  1297.    strDisplay = strDisplay & "Total directories in C: is " & cRcsCountFileDir(False, "C:", "", True) & vbCrLf
  1298.    strDisplay = strDisplay & "Total directories in D: is " & cRcsCountFileDir(False, "D:", "", True) & vbCrLf
  1299.    
  1300.    strDisplay = strDisplay & vbCrLf
  1301.  
  1302.    strDisplay = strDisplay & "Total files in C: is " & cRcsCountFileDir(True, "C:", "", True) & vbCrLf
  1303.    strDisplay = strDisplay & "Total files in D: is " & cRcsCountFileDir(True, "D:", "", True) & vbCrLf
  1304.    
  1305.    strDisplay = strDisplay & vbCrLf
  1306.  
  1307.    strDisplay = strDisplay & "Total files in C:*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", True) & vbCrLf
  1308.    strDisplay = strDisplay & "Total files in D:*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", True) & vbCrLf
  1309.    
  1310.    strDisplay = strDisplay & vbCrLf
  1311.  
  1312.    strDisplay = strDisplay & "Total directories in C:\ is " & cRcsCountFileDir(False, "C:", "", False) & vbCrLf
  1313.    strDisplay = strDisplay & "Total directories in D:\ is " & cRcsCountFileDir(False, "D:", "", False) & vbCrLf
  1314.    
  1315.    strDisplay = strDisplay & vbCrLf
  1316.  
  1317.    strDisplay = strDisplay & "Total files in C:\ is " & cRcsCountFileDir(True, "C:", "", False) & vbCrLf
  1318.    strDisplay = strDisplay & "Total files in D:\ is " & cRcsCountFileDir(True, "D:", "", False) & vbCrLf
  1319.    
  1320.    strDisplay = strDisplay & vbCrLf
  1321.  
  1322.    strDisplay = strDisplay & "Total files in C:\*.DAT is " & cRcsCountFileDir(True, "C:", "*.DAT", False) & vbCrLf
  1323.    strDisplay = strDisplay & "Total files in D:\*.DAT is " & cRcsCountFileDir(True, "D:", "*.DAT", False) & vbCrLf
  1324.    
  1325.    txt_Result = strDisplay
  1326.  
  1327.    'time the function
  1328.  
  1329.    TimerHandle = cTimerOpen()
  1330.    TimerStartOk = cTimerStart(TimerHandle)
  1331.    
  1332.    For i = 1 To Iteration
  1333.       lngResult = cRcsCountFileDir(False, "C:", "", False)
  1334.    Next i
  1335.    
  1336.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1337.    
  1338.    TimerCloseOk = cTimerClose(TimerHandle)
  1339.  
  1340. End Sub
  1341.  
  1342. Private Sub TestCountFiles()
  1343.  
  1344.    Dim lngResult        As Long
  1345.    Dim strResult        As String
  1346.    Dim strDisplay       As String
  1347.    
  1348.    Dim i                As Integer
  1349.    
  1350.    strResult = ""
  1351.    strDisplay = ""
  1352.    
  1353.    strDisplay = strDisplay & "Number of files in C:\ is " & cCountFiles("C:\*.*") & vbCrLf & vbCrLf
  1354.    strDisplay = strDisplay & "Number of files in D:\ is " & cCountFiles("D:\*.*") & vbCrLf & vbCrLf
  1355.    strDisplay = strDisplay & "Number of files in E:\ is " & cCountFiles("E:\*.*") & vbCrLf & vbCrLf
  1356.    
  1357.    txt_Result = strDisplay
  1358.  
  1359.    'time the function
  1360.  
  1361.    TimerHandle = cTimerOpen()
  1362.    TimerStartOk = cTimerStart(TimerHandle)
  1363.    
  1364.    For i = 1 To Iteration
  1365.       lngResult = cCountFiles("C:\*.*")
  1366.    Next i
  1367.    
  1368.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1369.    
  1370.    TimerCloseOk = cTimerClose(TimerHandle)
  1371.  
  1372. End Sub
  1373.  
  1374. Private Sub TestCountDirectories()
  1375.  
  1376.    Dim lngResult        As Long
  1377.    Dim strResult        As String
  1378.    Dim strDisplay       As String
  1379.    
  1380.    Dim i                As Integer
  1381.    
  1382.    strResult = ""
  1383.    strDisplay = ""
  1384.    
  1385.    strDisplay = strDisplay & "Number of directories in C:\ is " & cCountDirectories("C:\*.*") & vbCrLf & vbCrLf
  1386.    strDisplay = strDisplay & "Number of directories in D:\ is " & cCountDirectories("D:\*.*") & vbCrLf & vbCrLf
  1387.    strDisplay = strDisplay & "Number of directories in E:\ is " & cCountDirectories("E:\*.*") & vbCrLf & vbCrLf
  1388.    
  1389.    txt_Result = strDisplay
  1390.  
  1391.    'time the function
  1392.  
  1393.    TimerHandle = cTimerOpen()
  1394.    TimerStartOk = cTimerStart(TimerHandle)
  1395.    
  1396.    For i = 1 To Iteration
  1397.       lngResult = cCountDirectories("C:\*.*")
  1398.    Next i
  1399.    
  1400.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1401.    
  1402.    TimerCloseOk = cTimerClose(TimerHandle)
  1403.  
  1404. End Sub
  1405.  
  1406. Private Sub TestFilesSizeX()
  1407.  
  1408.    Dim lngResult        As Long
  1409.    Dim strResult        As String
  1410.    Dim strDisplay       As String
  1411.    
  1412.    Dim i                As Long
  1413.    
  1414.    Dim Size1            As Long
  1415.    Dim Size2            As Long
  1416.    
  1417.    strResult = ""
  1418.    strDisplay = ""
  1419.    
  1420.    strDisplay = strDisplay & "Size of files c:\*.* is " & cFilesSize("c:\*.*") & vbCrLf
  1421.    strDisplay = strDisplay & "Size of files c:\*.bat is " & cFilesSize("c:\*.bat") & vbCrLf
  1422.    strDisplay = strDisplay & "Size of files c:\*.sys is " & cFilesSize("c:\*.sys") & vbCrLf
  1423.    strDisplay = strDisplay & "Size of files c:\*.com is " & cFilesSize("c:\*.com") & vbCrLf
  1424.    strDisplay = strDisplay & vbCrLf
  1425.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cFilesSizeOnDisk("c:\*.*") & vbCrLf
  1426.    strDisplay = strDisplay & "Size of files c:\*.bat on disk is " & cFilesSizeOnDisk("c:\*.bat") & vbCrLf
  1427.    strDisplay = strDisplay & "Size of files c:\*.sys on disk is " & cFilesSizeOnDisk("c:\*.sys") & vbCrLf
  1428.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cFilesSizeOnDisk("c:\*.com") & vbCrLf
  1429.    strDisplay = strDisplay & vbCrLf
  1430.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cFilesSlack("c:\*.*", Size1, Size2) & " %" & vbCrLf
  1431.    strDisplay = strDisplay & "Slack of files c:\*.bat on disk is " & cFilesSlack("c:\*.bat", Size1, Size2) & " %" & vbCrLf
  1432.    strDisplay = strDisplay & "Slack of files c:\*.sys on disk is " & cFilesSlack("c:\*.sys", Size1, Size2) & " %" & vbCrLf
  1433.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cFilesSlack("c:\*.com", Size1, Size2) & " %" & vbCrLf
  1434.  
  1435.    txt_Result = strDisplay
  1436.  
  1437.    'time the function
  1438.  
  1439.    TimerHandle = cTimerOpen()
  1440.    TimerStartOk = cTimerStart(TimerHandle)
  1441.    
  1442.    For i = 1 To Iteration
  1443.       lngResult = cFilesSize("c:\*.*")
  1444.    Next i
  1445.    
  1446.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1447.    
  1448.    TimerCloseOk = cTimerClose(TimerHandle)
  1449.  
  1450. End Sub
  1451.  
  1452. Private Sub TestRcsFilesSizeX()
  1453.  
  1454.    Dim lngResult        As Long
  1455.    Dim strResult        As String
  1456.    Dim strDisplay       As String
  1457.    
  1458.    Dim i                As Long
  1459.    
  1460.    Dim Size1            As Long
  1461.    Dim Size2            As Long
  1462.    
  1463.    strResult = ""
  1464.    strDisplay = ""
  1465.    
  1466.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", False) & vbCrLf
  1467.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", False) & vbCrLf
  1468.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", False) & vbCrLf
  1469.    strDisplay = strDisplay & vbCrLf
  1470.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", False) & vbCrLf
  1471.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", False) & vbCrLf
  1472.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", False) & vbCrLf
  1473.    strDisplay = strDisplay & vbCrLf
  1474.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", False, Size1, Size2) & " %" & vbCrLf
  1475.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", False, Size1, Size2) & " %" & vbCrLf
  1476.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", False, Size1, Size2) & " %" & vbCrLf
  1477.  
  1478.    strDisplay = strDisplay & vbCrLf
  1479.  
  1480.    strDisplay = strDisplay & "Size of files c:\*.* is " & cRcsFilesSize("c:\", "*.*", True) & vbCrLf
  1481.    strDisplay = strDisplay & "Size of files c:\*.exe is " & cRcsFilesSize("c:\", "*.exe", True) & vbCrLf
  1482.    strDisplay = strDisplay & "Size of files c:\*.com is " & cRcsFilesSize("c:\", "*.com", True) & vbCrLf
  1483.    strDisplay = strDisplay & vbCrLf
  1484.    strDisplay = strDisplay & "Size of files c:\*.* on disk is " & cRcsFilesSizeOnDisk("c:\", "*.*", True) & vbCrLf
  1485.    strDisplay = strDisplay & "Size of files c:\*.exe on disk is " & cRcsFilesSizeOnDisk("c:\", "*.exe", True) & vbCrLf
  1486.    strDisplay = strDisplay & "Size of files c:\*.com on disk is " & cRcsFilesSizeOnDisk("c:\", "*.com", True) & vbCrLf
  1487.    strDisplay = strDisplay & vbCrLf
  1488.    strDisplay = strDisplay & "Slack of files c:\*.* on disk is " & cRcsFilesSlack("c:\", "*.*", True, Size1, Size2) & " %" & vbCrLf
  1489.    strDisplay = strDisplay & "Slack of files c:\*.exe on disk is " & cRcsFilesSlack("c:\", "*.exe", True, Size1, Size2) & " %" & vbCrLf
  1490.    strDisplay = strDisplay & "Slack of files c:\*.com on disk is " & cRcsFilesSlack("c:\", "*.com", True, Size1, Size2) & " %" & vbCrLf
  1491.  
  1492.    txt_Result = strDisplay
  1493.  
  1494.    'time the function
  1495.  
  1496.    TimerHandle = cTimerOpen()
  1497.    TimerStartOk = cTimerStart(TimerHandle)
  1498.    
  1499.    For i = 1 To Iteration
  1500.       lngResult = cRcsFilesSize("c:\", "*.*", False)
  1501.    Next i
  1502.    
  1503.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1504.    
  1505.    TimerCloseOk = cTimerClose(TimerHandle)
  1506.  
  1507. End Sub
  1508.  
  1509. Private Sub TestTruncatePath()
  1510.  
  1511.    Dim intResult        As Integer
  1512.    Dim strResult        As String
  1513.    Dim strDisplay       As String
  1514.    
  1515.    Dim i                As Integer
  1516.    
  1517.    Dim File1            As String
  1518.    
  1519.    strResult = ""
  1520.    strDisplay = ""
  1521.    
  1522.    strDisplay = strDisplay & "Truncate the following path with a length of 25" & vbCrLf & vbCrLf
  1523.  
  1524.    File1 = "t2win-16.bas"
  1525.    strResult = cTruncatePath(File1, 25)
  1526.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1527.  
  1528.    File1 = "windows\system\t2win-16.bas"
  1529.    strResult = cTruncatePath(File1, 25)
  1530.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1531.  
  1532.    File1 = "c:\win95\system\t2win-16.bas"
  1533.    strResult = cTruncatePath(File1, 25)
  1534.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1535.  
  1536.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1537.    strResult = cTruncatePath(File1, 25)
  1538.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1539.  
  1540.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1541.    strResult = cTruncatePath(File1, 25)
  1542.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1543.  
  1544.    strDisplay = strDisplay & "Truncate the following path with a length of 35" & vbCrLf & vbCrLf
  1545.  
  1546.    File1 = "t2win-16.bas"
  1547.    strResult = cTruncatePath(File1, 35)
  1548.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1549.  
  1550.    File1 = "windows\system\t2win-16.bas"
  1551.    strResult = cTruncatePath(File1, 35)
  1552.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1553.  
  1554.    File1 = "c:\win95\system\t2win-16.bas"
  1555.    strResult = cTruncatePath(File1, 35)
  1556.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1557.  
  1558.    File1 = "c:\win95\system\visual\t2win-16\t2win-16.bas"
  1559.    strResult = cTruncatePath(File1, 35)
  1560.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf
  1561.  
  1562.    File1 = "c:\win95\system\visual\source\t2win-16\t2win-16.bas"
  1563.    strResult = cTruncatePath(File1, 35)
  1564.    strDisplay = strDisplay & File1 & vbCrLf & " -> " & strResult & "  (len=" & Len(strResult) & ")" & vbCrLf & vbCrLf
  1565.      
  1566.    txt_Result = strDisplay
  1567.  
  1568.    'time the function
  1569.  
  1570.    TimerHandle = cTimerOpen()
  1571.    TimerStartOk = cTimerStart(TimerHandle)
  1572.    
  1573.    For i = 1 To Iteration
  1574.       strResult = cTruncatePath(File1, 35)
  1575.    Next i
  1576.    
  1577.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1578.    
  1579.    TimerCloseOk = cTimerClose(TimerHandle)
  1580.  
  1581. End Sub
  1582.  
  1583. Private Sub TestMakeSplitPath()
  1584.  
  1585.    Dim intResult        As Integer
  1586.    Dim strResult        As String
  1587.    Dim strDisplay       As String
  1588.    
  1589.    Dim i                As Integer
  1590.    
  1591.    Dim SPLITPATH        As tagSPLITPATH
  1592.  
  1593.    Dim File1            As String
  1594.    
  1595.    strResult = ""
  1596.    strDisplay = ""
  1597.    
  1598.    File1 = cMakePath("c", "\this is a test", "test", "dat")
  1599.    
  1600.    strDisplay = strDisplay & "Make Path of (c,\this is a test,test,dat) is '" & File1 & "'" & vbCrLf & vbCrLf
  1601.    
  1602.    strDisplay = strDisplay & "Split Path '" & File1 & "' into four components is :" & vbCrLf & vbCrLf
  1603.    intResult = cSplitPath(File1, SPLITPATH)
  1604.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDrive & vbCrLf
  1605.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nDir & vbCrLf
  1606.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nName & vbCrLf
  1607.    strDisplay = strDisplay & Space$(3) & SPLITPATH.nExt & vbCrLf & vbCrLf
  1608.    
  1609.    txt_Result = strDisplay
  1610.  
  1611.    'time the function
  1612.  
  1613.    TimerHandle = cTimerOpen()
  1614.    TimerStartOk = cTimerStart(TimerHandle)
  1615.    
  1616.    For i = 1 To Iteration
  1617.       strResult = cMakePath("c", "this is a test", "test", "dat")
  1618.    Next i
  1619.    
  1620.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1621.    
  1622.    TimerCloseOk = cTimerClose(TimerHandle)
  1623.  
  1624. End Sub
  1625.  
  1626. Private Sub TestFullPath()
  1627.  
  1628.    Dim intResult        As Integer
  1629.    Dim strResult        As String
  1630.    Dim strDisplay       As String
  1631.    
  1632.    Dim i                As Integer
  1633.    
  1634.    Dim File1            As String
  1635.    
  1636.    strResult = ""
  1637.    strDisplay = ""
  1638.    
  1639.    File1 = T2WFileTest
  1640.  
  1641.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1642.  
  1643.    File1 = cGetSystemDirectory() & "\t2win-32.dll"
  1644.  
  1645.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1646.  
  1647.    File1 = cFilesInDirectory(cGetDefaultCurrentDir() + "\*.*", True)
  1648.  
  1649.    strDisplay = strDisplay & "Full Path of " & File1 & " is " & cFullPath(File1) & vbCrLf & vbCrLf
  1650.    
  1651.    txt_Result = strDisplay
  1652.  
  1653.    'time the function
  1654.  
  1655.    TimerHandle = cTimerOpen()
  1656.    TimerStartOk = cTimerStart(TimerHandle)
  1657.    
  1658.    For i = 1 To Iteration
  1659.       strResult = cFullPath(File1)
  1660.    Next i
  1661.    
  1662.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1663.    
  1664.    TimerCloseOk = cTimerClose(TimerHandle)
  1665.  
  1666. End Sub
  1667.  
  1668. Private Sub TestRenameFile()
  1669.  
  1670.    Dim intResult        As Integer
  1671.    Dim strResult        As String
  1672.    Dim strDisplay       As String
  1673.    
  1674.    Dim i                As Integer
  1675.    
  1676.    Dim File1            As String
  1677.    Dim File2            As String
  1678.    
  1679.    strResult = ""
  1680.    strDisplay = ""
  1681.    
  1682.    File1 = "this.is.a.test.~~~"
  1683.    File2 = "an another test.---"
  1684.    
  1685.    intResult = cKillFile(File1)
  1686.    intResult = cKillFile(File2)
  1687.    
  1688.    Close #1
  1689.    Open File1 For Output Shared As #1
  1690.    Print #1, File1
  1691.    Print #1, File2
  1692.    Close #1
  1693.  
  1694.    strDisplay = "File '" & File1 & "' " & IIf(cRenameFile(File1, File2) = True, "renamed in '" & File2 & "'", "is not renamed") & vbCrLf & vbCrLf
  1695.  
  1696.    txt_Result = strDisplay
  1697.  
  1698.    'time the function
  1699.  
  1700.    TimerHandle = cTimerOpen()
  1701.    TimerStartOk = cTimerStart(TimerHandle)
  1702.    
  1703.    For i = 1 To Iteration
  1704.       intResult = cRenameFile(File1, File2)
  1705.    Next i
  1706.    
  1707.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1708.    
  1709.    TimerCloseOk = cTimerClose(TimerHandle)
  1710.  
  1711. End Sub
  1712.  
  1713. Public Sub TestUniqueFileName()
  1714.  
  1715.    Dim intResult        As Integer
  1716.    Dim strResult        As String
  1717.    Dim strDisplay       As String
  1718.    
  1719.    Dim i                As Integer
  1720.    
  1721.    Dim File1            As String
  1722.    
  1723.    strResult = ""
  1724.    strDisplay = ""
  1725.    
  1726.    File1 = "WN"
  1727.  
  1728.    strDisplay = strDisplay + "Generate unique filename with template '" & File1 & "' is '" & cUniqueFileName(File1) & "'" & vbCrLf & vbCrLf
  1729.    
  1730.    txt_Result = strDisplay
  1731.  
  1732.    'time the function
  1733.  
  1734.    TimerHandle = cTimerOpen()
  1735.    TimerStartOk = cTimerStart(TimerHandle)
  1736.    
  1737.    For i = 1 To Iteration
  1738.       strResult = cUniqueFileName(File1)
  1739.    Next i
  1740.    
  1741.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1742.    
  1743.    TimerCloseOk = cTimerClose(TimerHandle)
  1744.  
  1745. End Sub
  1746.  
  1747. Private Sub TestFilesInDirectory()
  1748.  
  1749.    Dim intResult        As Integer
  1750.    Dim strResult        As String
  1751.    Dim strDisplay       As String
  1752.    
  1753.    Dim i                As Integer
  1754.    
  1755.    Dim File1            As String
  1756.    
  1757.    strResult = ""
  1758.    strDisplay = ""
  1759.    
  1760.    File1 = "*.*"
  1761.  
  1762.    strDisplay = strDisplay + "The 10 first files in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1763.  
  1764.    strResult = cFilesInDirectory(File1, True)
  1765.    For i = 1 To 10
  1766.       strDisplay = strDisplay & strResult & vbCrLf
  1767.       strResult = cFilesInDirectory(File1, False)
  1768.    Next i
  1769.    
  1770.    strDisplay = strDisplay + vbCrLf
  1771.  
  1772.    File1 = "C:\*.*"
  1773.  
  1774.    strDisplay = strDisplay + "The 10 first files in '" & File1 & "'" & vbCrLf & vbCrLf
  1775.  
  1776.    strResult = cFilesInDirectory(File1, True)
  1777.    For i = 1 To 10
  1778.       strDisplay = strDisplay & strResult & vbCrLf
  1779.       strResult = cFilesInDirectory(File1, False)
  1780.    Next i
  1781.    
  1782.    txt_Result = strDisplay
  1783.  
  1784.    'time the function
  1785.  
  1786.    TimerHandle = cTimerOpen()
  1787.    TimerStartOk = cTimerStart(TimerHandle)
  1788.    
  1789.    For i = 1 To Iteration
  1790.       strResult = cFilesInDirectory(File1, True)
  1791.    Next i
  1792.    
  1793.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1794.    
  1795.    TimerCloseOk = cTimerClose(TimerHandle)
  1796.  
  1797. End Sub
  1798.  
  1799. Private Sub TestSubDirectory()
  1800.  
  1801.    Dim intResult        As Integer
  1802.    Dim strResult        As String
  1803.    Dim strDisplay       As String
  1804.    
  1805.    Dim i                As Integer
  1806.    
  1807.    Dim File1            As String
  1808.    
  1809.    strResult = ""
  1810.    strDisplay = ""
  1811.    
  1812.    File1 = "*.*"
  1813.  
  1814.    strDisplay = strDisplay + "The 10 first directory in the current directory '" & cGetDriveCurrentDir("C") & "'" & vbCrLf & vbCrLf
  1815.  
  1816.    strResult = cSubDirectory(File1, True)
  1817.    For i = 1 To 10
  1818.       strDisplay = strDisplay & strResult & vbCrLf
  1819.       strResult = cSubDirectory(File1, False)
  1820.    Next i
  1821.    
  1822.    strDisplay = strDisplay + vbCrLf
  1823.  
  1824.    File1 = "C:\*.*"
  1825.  
  1826.    strDisplay = strDisplay + "The 10 first directory in '" & File1 & "'" & vbCrLf & vbCrLf
  1827.  
  1828.    strResult = cSubDirectory(File1, True)
  1829.    For i = 1 To 10
  1830.       strDisplay = strDisplay & strResult & vbCrLf
  1831.       strResult = cSubDirectory(File1, False)
  1832.    Next i
  1833.    
  1834.    txt_Result = strDisplay
  1835.  
  1836.    'time the function
  1837.  
  1838.    TimerHandle = cTimerOpen()
  1839.    TimerStartOk = cTimerStart(TimerHandle)
  1840.    
  1841.    For i = 1 To Iteration
  1842.       strResult = cSubDirectory(File1, True)
  1843.    Next i
  1844.    
  1845.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1846.    
  1847.    TimerCloseOk = cTimerClose(TimerHandle)
  1848.  
  1849. End Sub
  1850.  
  1851. Private Sub TestFileGetAttribute()
  1852.  
  1853.    Dim intResult        As Integer
  1854.    Dim strResult        As String
  1855.    Dim strDisplay       As String
  1856.    
  1857.    Dim i                As Integer
  1858.    
  1859.    Dim File1            As String
  1860.    
  1861.    Dim FileAttrib       As FileAttributeType
  1862.  
  1863.    strResult = ""
  1864.    strDisplay = ""
  1865.    
  1866.    File1 = cFilesInDirectory("*.*", True)
  1867.    intResult = cFileGetAttrib(File1, FileAttrib)
  1868.  
  1869.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1870.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1871.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1872.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1873.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1874.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1875.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1876.      
  1877.    File1 = cGetWindowsDirectory() & "\user.dat"
  1878.    intResult = cFileGetAttrib(File1, FileAttrib)
  1879.    
  1880.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1881.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1882.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1883.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1884.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1885.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1886.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1887.      
  1888.    File1 = cSubDirectory("c:\*.*", True)
  1889.    File1 = cSubDirectory("c:\*.*", False)
  1890.    File1 = cSubDirectory("c:\*.*", False)
  1891.    File1 = "c:\" & File1
  1892.    intResult = cFileGetAttrib(File1, FileAttrib)
  1893.    
  1894.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1895.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1896.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1897.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1898.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1899.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1900.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1901.      
  1902.    txt_Result = strDisplay
  1903.  
  1904.    'time the function
  1905.  
  1906.    TimerHandle = cTimerOpen()
  1907.    TimerStartOk = cTimerStart(TimerHandle)
  1908.    
  1909.    For i = 1 To Iteration
  1910.       intResult = cFileGetAttrib(File1, FileAttrib)
  1911.    Next i
  1912.    
  1913.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1914.    
  1915.    TimerCloseOk = cTimerClose(TimerHandle)
  1916.  
  1917. End Sub
  1918.  
  1919. Private Sub TestFileSetAttribute()
  1920.  
  1921.    Dim intResult        As Integer
  1922.    Dim strResult        As String
  1923.    Dim strDisplay       As String
  1924.    
  1925.    Dim i                As Integer
  1926.    
  1927.    Dim File1            As String
  1928.    
  1929.    Dim FileAttrib       As FileAttributeType
  1930.  
  1931.    strResult = ""
  1932.    strDisplay = ""
  1933.    
  1934.    File1 = cFilesInDirectory("*.*", True)
  1935.    intResult = cFileGetAttrib(File1, FileAttrib)
  1936.  
  1937.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1938.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1939.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1940.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1941.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1942.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1943.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1944.    
  1945.    FileAttrib.Archive = False
  1946.    FileAttrib.Hidden = True
  1947.    FileAttrib.ReadOnly = True
  1948.    FileAttrib.System = True
  1949.    
  1950.    intResult = cFileSetAttrib(File1, FileAttrib)
  1951.    
  1952.    strDisplay = strDisplay & "Setting attribute (not archive, hidden, readonly, system) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  1953.      
  1954.    intResult = cFileGetAttrib(File1, FileAttrib)
  1955.    
  1956.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  1957.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  1958.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  1959.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  1960.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  1961.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  1962.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  1963.  
  1964.    txt_Result = strDisplay
  1965.  
  1966.    'time the function
  1967.  
  1968.    TimerHandle = cTimerOpen()
  1969.    TimerStartOk = cTimerStart(TimerHandle)
  1970.    
  1971.    For i = 1 To Iteration
  1972.       intResult = cFileSetAttrib(File1, FileAttrib)
  1973.    Next i
  1974.    
  1975.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  1976.    
  1977.    TimerCloseOk = cTimerClose(TimerHandle)
  1978.  
  1979. End Sub
  1980.  
  1981. Private Sub TestFileSetAllAttributes()
  1982.  
  1983.    Dim intResult        As Integer
  1984.    Dim strResult        As String
  1985.    Dim strDisplay       As String
  1986.    
  1987.    Dim i                As Integer
  1988.    
  1989.    Dim File1            As String
  1990.    
  1991.    Dim FileAttrib       As FileAttributeType
  1992.  
  1993.    strResult = ""
  1994.    strDisplay = ""
  1995.    
  1996.    File1 = cFilesInDirectory("*.*", True)
  1997.    intResult = cFileGetAttrib(File1, FileAttrib)
  1998.  
  1999.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2000.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2001.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2002.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2003.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2004.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2005.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2006.    
  2007.    intResult = cFileSetAllAttrib(File1)
  2008.    
  2009.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  2010.      
  2011.    intResult = cFileGetAttrib(File1, FileAttrib)
  2012.    
  2013.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2014.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2015.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2016.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2017.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2018.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2019.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2020.  
  2021.    txt_Result = strDisplay
  2022.  
  2023.    'time the function
  2024.  
  2025.    TimerHandle = cTimerOpen()
  2026.    TimerStartOk = cTimerStart(TimerHandle)
  2027.    
  2028.    For i = 1 To Iteration
  2029.       intResult = cFileSetAllAttrib(File1)
  2030.    Next i
  2031.    
  2032.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2033.    
  2034.    TimerCloseOk = cTimerClose(TimerHandle)
  2035.  
  2036. End Sub
  2037.  
  2038. Public Sub TestFileResetAllAttributes()
  2039.  
  2040.    Dim intResult        As Integer
  2041.    Dim strResult        As String
  2042.    Dim strDisplay       As String
  2043.    
  2044.    Dim i                As Integer
  2045.    
  2046.    Dim File1            As String
  2047.    
  2048.    Dim FileAttrib       As FileAttributeType
  2049.  
  2050.    strResult = ""
  2051.    strDisplay = ""
  2052.    
  2053.    File1 = cFilesInDirectory("*.*", True)
  2054.    intResult = cFileGetAttrib(File1, FileAttrib)
  2055.  
  2056.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2057.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2058.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2059.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2060.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2061.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2062.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2063.    
  2064.    intResult = cFileResetAllAttrib(File1)
  2065.    
  2066.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) to file '" & File1 & "' is " & intResult & vbCrLf & vbCrLf
  2067.      
  2068.    intResult = cFileGetAttrib(File1, FileAttrib)
  2069.    
  2070.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Archive, " is Archive", " is not Archive") & vbCrLf
  2071.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Hidden, " is Hidden", " is not Hidden") & vbCrLf
  2072.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Normal, " is Normal", " is not Normal") & vbCrLf
  2073.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.ReadOnly, " is ReadOnly", " is not ReadOnly") & vbCrLf
  2074.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.SubDir, " is SubDir", " is not SubDir") & vbCrLf
  2075.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.System, " is System", " is not System") & vbCrLf
  2076.    strDisplay = strDisplay & "File '" & File1 & "'" & IIf(FileAttrib.Compressed, " is Compressed", " is not Compressed") & vbCrLf & vbCrLf
  2077.  
  2078.    txt_Result = strDisplay
  2079.  
  2080.    'time the function
  2081.  
  2082.    TimerHandle = cTimerOpen()
  2083.    TimerStartOk = cTimerStart(TimerHandle)
  2084.    
  2085.    For i = 1 To Iteration
  2086.       intResult = cFileResetAllAttrib(File1)
  2087.    Next i
  2088.    
  2089.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2090.    
  2091.    TimerCloseOk = cTimerClose(TimerHandle)
  2092.  
  2093. End Sub
  2094.  
  2095. Public Sub TestFileCompareX()
  2096.  
  2097.    Dim intResult        As Integer
  2098.    Dim strResult        As String
  2099.    Dim strDisplay       As String
  2100.    
  2101.    Dim i                As Integer
  2102.    
  2103.    Dim File1            As String
  2104.    Dim File2            As String
  2105.    
  2106.    Dim FileAttrib       As FileAttributeType
  2107.  
  2108.    strResult = ""
  2109.    strDisplay = ""
  2110.    
  2111.    File1 = T2WFileTest
  2112.    File2 = "autoexec.compare"
  2113.    
  2114.    strDisplay = strDisplay & "File Copy '" & File1 & "' to '" & File2 & "' is " & cFileCopy(File1, File2) & vbCrLf & vbCrLf
  2115.    
  2116.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2117.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2118.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2119.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2120.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2121.      
  2122.    Close #1
  2123.    Open File2 For Append Shared As #1
  2124.    Print #1, File2
  2125.    Close #1
  2126.      
  2127.    strDisplay = strDisplay & "Appending " & (Len(File2) + 2) & " chars to '" & File2 & "'" & vbCrLf & vbCrLf
  2128.    
  2129.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2130.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2131.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2132.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2133.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2134.      
  2135.    strDisplay = strDisplay & "Resetting all attributes (except normal, compressed) is " & cFileResetAllAttrib(File2) & vbCrLf & vbCrLf
  2136.    
  2137.    strDisplay = strDisplay & "Compare file attribute '" & File1 & "' with '" & File2 & "' is " & cCmpFileAttribute(File1, File2) & vbCrLf
  2138.    strDisplay = strDisplay & "Compare file size '" & File1 & "' with '" & File2 & "' is " & cCmpFileSize(File1, File2) & vbCrLf
  2139.    strDisplay = strDisplay & "Compare file time '" & File1 & "' with '" & File2 & "' is " & cCmpFileTime(File1, File2) & vbCrLf
  2140.    strDisplay = strDisplay & "Compare file contents (case sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, True) & vbCrLf
  2141.    strDisplay = strDisplay & "Compare file contents (not sensitive) '" & File1 & "' with '" & File2 & "' is " & cCmpFileContents(File1, File2, False) & vbCrLf & vbCrLf
  2142.      
  2143.    txt_Result = strDisplay
  2144.  
  2145.    'time the function
  2146.  
  2147.    TimerHandle = cTimerOpen()
  2148.    TimerStartOk = cTimerStart(TimerHandle)
  2149.    
  2150.    For i = 1 To Iteration
  2151.       intResult = cCmpFileSize(File1, File2)
  2152.    Next i
  2153.    
  2154.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2155.    
  2156.    TimerCloseOk = cTimerClose(TimerHandle)
  2157.  
  2158. End Sub
  2159.  
  2160. Private Sub TestFileDrive()
  2161.  
  2162.    Dim intResult        As Integer
  2163.    Dim strResult        As String
  2164.    Dim strDisplay       As String
  2165.    
  2166.    Dim i                As Integer
  2167.    
  2168.    Dim File1            As String
  2169.    
  2170.    strResult = ""
  2171.    strDisplay = ""
  2172.    
  2173.    File1 = T2WFileTest
  2174.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  2175.    
  2176.    File1 = cGetWindowsDirectory() + "\user.dat"
  2177.    strDisplay = strDisplay & "File drive of '" & File1 & "' is " & cFileDrive(File1) & vbCrLf & vbCrLf
  2178.    
  2179.    txt_Result = strDisplay
  2180.  
  2181.    'time the function
  2182.  
  2183.    TimerHandle = cTimerOpen()
  2184.    TimerStartOk = cTimerStart(TimerHandle)
  2185.    
  2186.    For i = 1 To Iteration
  2187.       strResult = cFileDrive(File1)
  2188.    Next i
  2189.    
  2190.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2191.    
  2192.    TimerCloseOk = cTimerClose(TimerHandle)
  2193.  
  2194. End Sub
  2195.  
  2196. Private Sub TestFilesInDirOnDisk()
  2197.  
  2198.    Dim lngResult        As Long
  2199.    Dim strResult        As String
  2200.    Dim strDisplay       As String
  2201.    
  2202.    Dim i                As Integer
  2203.    
  2204.    Dim File1            As String
  2205.    Dim File2            As String
  2206.    
  2207.    strResult = ""
  2208.    strDisplay = ""
  2209.    
  2210.    File1 = "filesindirondisk.temp"
  2211.    File2 = "c:\*.*"
  2212.    
  2213.    strDisplay = strDisplay & "Number of files '" & File2 & "' (with at least one of the following attribute)" & vbCrLf & vbCrLf
  2214.  
  2215.    strDisplay = strDisplay & "Any : " & cFilesInDirOnDisk(File1, File2, A_ALL) & vbCrLf
  2216.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL) & vbCrLf
  2217.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, A_NORMAL_ARCHIVE) & vbCrLf
  2218.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE) & vbCrLf
  2219.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_ARCHIVE Or A_RDONLY) & vbCrLf
  2220.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_SYSTEM Or A_HIDDEN Or A_RDONLY) & vbCrLf
  2221.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_HIDDEN Or A_RDONLY) & vbCrLf
  2222.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, A_RDONLY) & vbCrLf
  2223.    strDisplay = strDisplay & vbCrLf
  2224.  
  2225.    strDisplay = strDisplay & "Number of files in '" & File2 & "' (with exact attribute excluding all others)" & vbCrLf & vbCrLf
  2226.  
  2227.    strDisplay = strDisplay & "(N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL)) & vbCrLf
  2228.    strDisplay = strDisplay & "(A)rchive, (N)ormal : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL_ARCHIVE)) & vbCrLf
  2229.    strDisplay = strDisplay & "(A)rchive : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE)) & vbCrLf
  2230.    strDisplay = strDisplay & "(A)rchive, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_ARCHIVE Or A_RDONLY)) & vbCrLf
  2231.    strDisplay = strDisplay & "(S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  2232.    strDisplay = strDisplay & "(A)rchive, (S)ystem, (H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_NORMAL Or A_SYSTEM Or A_HIDDEN Or A_RDONLY)) & vbCrLf
  2233.    strDisplay = strDisplay & "(H)idden, (R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_HIDDEN Or A_RDONLY)) & vbCrLf
  2234.    strDisplay = strDisplay & "(R)ead-Only : " & cFilesInDirOnDisk(File1, File2, -(A_RDONLY)) & vbCrLf
  2235.    strDisplay = strDisplay & vbCrLf
  2236.    
  2237.    txt_Result = strDisplay
  2238.  
  2239.    'time the function
  2240.  
  2241.    TimerHandle = cTimerOpen()
  2242.    TimerStartOk = cTimerStart(TimerHandle)
  2243.    
  2244.    For i = 1 To Iteration
  2245.       lngResult = cFilesInDirOnDisk(File1, File2, A_ALL)
  2246.    Next i
  2247.    
  2248.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2249.    
  2250.    TimerCloseOk = cTimerClose(TimerHandle)
  2251.  
  2252. End Sub
  2253.  
  2254. Private Sub TestFileDateTime()
  2255.  
  2256.    Dim intResult        As Integer
  2257.    Dim strResult        As String
  2258.    Dim strDisplay       As String
  2259.    
  2260.    Dim i                As Integer
  2261.    
  2262.    Dim File1            As String
  2263.    
  2264.    strResult = ""
  2265.    strDisplay = ""
  2266.    
  2267.    File1 = T2WFileTest
  2268.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2269.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2270.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2271.    
  2272.    File1 = "c:\config.sys"
  2273.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2274.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2275.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2276.    
  2277.    File1 = cGetSystemDirectory() + "\t2win-32.dll"
  2278.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2279.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2280.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2281.    
  2282.    File1 = cGetWindowsDirectory() + "\user.dat"
  2283.    strDisplay = strDisplay & "File creation for '" & File1 & "' is " & cFileDateCreated(File1) & " " & cFileTimeCreated(File1) & vbCrLf
  2284.    strDisplay = strDisplay & "File last access for '" & File1 & "' is " & cFileLastDateAccess(File1) & " " & cFileLastTimeAccess(File1) & vbCrLf
  2285.    strDisplay = strDisplay & "File last modification for '" & File1 & "' is " & cFileLastDateModified(File1) & " " & cFileLastTimeModified(File1) & vbCrLf & vbCrLf
  2286.    
  2287.    txt_Result = strDisplay
  2288.  
  2289.    'time the function
  2290.  
  2291.    TimerHandle = cTimerOpen()
  2292.    TimerStartOk = cTimerStart(TimerHandle)
  2293.    
  2294.    For i = 1 To Iteration
  2295.       strResult = cFileDateCreated(File1)
  2296.    Next i
  2297.    
  2298.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2299.    
  2300.    TimerCloseOk = cTimerClose(TimerHandle)
  2301.  
  2302. End Sub
  2303.  
  2304. Private Sub TestFileStatistics()
  2305.  
  2306.    Dim lngResult        As Long
  2307.    Dim strResult        As String
  2308.    Dim strDisplay       As String
  2309.    
  2310.    Dim i                As Integer
  2311.    
  2312.    Dim nL               As Long
  2313.    Dim nW               As Long
  2314.    Dim nC               As Long
  2315.    
  2316.    Dim File1            As String
  2317.    
  2318.    strResult = ""
  2319.    strDisplay = ""
  2320.    
  2321.    File1 = T2WFileTest
  2322.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  2323.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  2324.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  2325.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  2326.  
  2327.    File1 = "c:\config.sys"
  2328.    strDisplay = strDisplay & "File statictics for '" & File1 & "' is " & cFileStatistics(File1, nL, nW, nC) & vbCrLf
  2329.    strDisplay = strDisplay & "number of lines : " & nL & vbCrLf
  2330.    strDisplay = strDisplay & "number of words : " & nW & vbCrLf
  2331.    strDisplay = strDisplay & "number of chars : " & nC & vbCrLf & vbCrLf
  2332.  
  2333.    txt_Result = strDisplay
  2334.  
  2335.    'time the function
  2336.  
  2337.    TimerHandle = cTimerOpen()
  2338.    TimerStartOk = cTimerStart(TimerHandle)
  2339.    
  2340.    For i = 1 To Iteration
  2341.       lngResult = cFileStatistics(File1, nL, nW, nC)
  2342.    Next i
  2343.    
  2344.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2345.    
  2346.    TimerCloseOk = cTimerClose(TimerHandle)
  2347.  
  2348. End Sub
  2349.  
  2350. Private Sub TestGetDriveType()
  2351.  
  2352.    Dim intResult        As Integer
  2353.    Dim strResult        As String
  2354.    Dim strDisplay       As String
  2355.    
  2356.    Dim i                As Integer
  2357.    
  2358.    strResult = ""
  2359.    strDisplay = ""
  2360.    
  2361.    For i = 1 To 26
  2362.       intResult = cGetDriveType(Chr$(64 + i))
  2363.       If (intResult > 0) Then
  2364.          strDisplay = strDisplay & "'" & Chr$(64 + i) & ":' is "
  2365.          Select Case intResult
  2366.             Case DRIVE_UNKNOWN
  2367.                strDisplay = strDisplay & "(unknown)" & vbCrLf
  2368.             Case DRIVE_NO_ROOT_DIR
  2369.                strDisplay = strDisplay & "(not root dir)" & vbCrLf
  2370.             Case DRIVE_REMOVABLE
  2371.                strDisplay = strDisplay & "removable" & vbCrLf
  2372.             Case DRIVE_FIXED
  2373.                strDisplay = strDisplay & "fixed disk" & vbCrLf
  2374.             Case DRIVE_REMOTE
  2375.                strDisplay = strDisplay & "remote disk" & vbCrLf
  2376.             Case DRIVE_CDROM
  2377.                strDisplay = strDisplay & "cd-rom" & vbCrLf
  2378.             Case DRIVE_RAMDISK
  2379.                strDisplay = strDisplay & "ram disk" & vbCrLf
  2380.          End Select
  2381.       End If
  2382.    Next i
  2383.      
  2384.    txt_Result = strDisplay
  2385.  
  2386.    'time the function
  2387.  
  2388.    TimerHandle = cTimerOpen()
  2389.    TimerStartOk = cTimerStart(TimerHandle)
  2390.    
  2391.    For i = 1 To Iteration
  2392.       intResult = cGetDriveType("C")
  2393.    Next i
  2394.    
  2395.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2396.    
  2397.    TimerCloseOk = cTimerClose(TimerHandle)
  2398.  
  2399. End Sub
  2400.  
  2401. Private Sub TestPBFileCopy()
  2402.  
  2403.    Dim intResult        As Long
  2404.    Dim strResult        As String
  2405.    Dim strDisplay       As String
  2406.    
  2407.    Dim i                As Long
  2408.    
  2409.    Dim File1            As String
  2410.    Dim File2            As String
  2411.   
  2412.    strResult = ""
  2413.    strDisplay = ""
  2414.    
  2415.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  2416.    File2 = "system.pbcopy"
  2417.    
  2418.    strDisplay = strDisplay & "PB File Copy '" & File1 & "' to '" & File2 & "' is " & cPBFileCopy(Me.hWnd, File1, File2) & vbCrLf & vbCrLf
  2419.    
  2420.    txt_Result = strDisplay
  2421.  
  2422.    'time the function
  2423.       
  2424.    DoEvents
  2425.    
  2426.    TimerHandle = cTimerOpen()
  2427.    TimerStartOk = cTimerStart(TimerHandle)
  2428.    
  2429.    For i = 1 To Iteration
  2430.       intResult = cPBFileCopy(Me.hWnd, File1, File2)
  2431.       DoEvents
  2432.    Next i
  2433.    
  2434.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2435.    
  2436.    TimerCloseOk = cTimerClose(TimerHandle)
  2437.  
  2438. End Sub
  2439.  
  2440. Private Sub TestDBFileCopy()
  2441.  
  2442.    Dim intResult        As Integer
  2443.    Dim strResult        As String
  2444.    Dim strDisplay       As String
  2445.    
  2446.    Dim i                As Long
  2447.    
  2448.    Dim File1            As String
  2449.    Dim File2            As String
  2450.   
  2451.    strResult = ""
  2452.    strDisplay = ""
  2453.    
  2454.    File1 = cGetWindowsDirectory() + "\" + "system.dat"
  2455.    File2 = "system.dbcopy"
  2456.    
  2457.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  2458.    
  2459.    File1 = cGetWindowsDirectory() + "\" + "command.com"
  2460.    File2 = "command.dbcopy"
  2461.    
  2462.    strDisplay = strDisplay & "DB File Copy '" & File1 & "' to '" & File2 & "' is " & cDBFileCopy("", "", "", "", File1, File2) & vbCrLf & vbCrLf
  2463.    
  2464.    txt_Result = strDisplay
  2465.  
  2466.    'time the function
  2467.  
  2468.    DoEvents
  2469.    
  2470.    TimerHandle = cTimerOpen()
  2471.    TimerStartOk = cTimerStart(TimerHandle)
  2472.    
  2473.    For i = 1 To Iteration
  2474.       intResult = cDBFileCopy("", "", "", "", File1, File2)
  2475.       DoEvents
  2476.    Next i
  2477.    
  2478.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2479.    
  2480.    TimerCloseOk = cTimerClose(TimerHandle)
  2481.  
  2482. End Sub
  2483.  
  2484. Private Sub TestFileUUCP()
  2485.  
  2486.    Dim lngResult        As Long
  2487.    Dim strResult        As String
  2488.    Dim strDisplay       As String
  2489.    
  2490.    Dim i                As Integer
  2491.    
  2492.    Dim File1            As String
  2493.    Dim File2            As String
  2494.    Dim File3            As String
  2495.    
  2496.    strResult = ""
  2497.    strDisplay = ""
  2498.    
  2499.    File1 = "c:\win95\system.dat"
  2500.    File2 = "system.uuencoded"
  2501.    File3 = "system.uudecoded"
  2502.    
  2503.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  2504.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  2505.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2506.  
  2507.    File1 = T2WFileTest
  2508.    File2 = "autoexec.uuencoded"
  2509.    File3 = "autoexec.uudecoded"
  2510.    
  2511.    strDisplay = strDisplay & "File UUencode '" & File1 & "' to '" & File2 & "' is " & cFileUUCP(File1, File2, MODE_UUENCODE) & vbCrLf
  2512.    strDisplay = strDisplay & "File UUdecode '" & File2 & "' to '" & File3 & "' is " & cFileUUCP(File2, File3, MODE_UUDECODE) & vbCrLf
  2513.    strDisplay = strDisplay & "Compare File contents (not sensitive) '" & File1 & "' with '" & File3 & "' is " & IIf(cCmpFileContents(File1, File3, False) = -1, "same", "not same") & vbCrLf & vbCrLf
  2514.  
  2515.    txt_Result = strDisplay
  2516.  
  2517.    'time the function
  2518.  
  2519.    TimerHandle = cTimerOpen()
  2520.    TimerStartOk = cTimerStart(TimerHandle)
  2521.    
  2522.    For i = 1 To Iteration
  2523.       lngResult = cFileUUCP(File1, File2, MODE_UUENCODE)
  2524.    Next i
  2525.    
  2526.    lngResult = cFileUUCP(File2, File3, MODE_UUDECODE)
  2527.    
  2528.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  2529.    
  2530.    TimerCloseOk = cTimerClose(TimerHandle)
  2531.  
  2532. End Sub
  2533.